package application;
import cn.edu.scau.cmi.leon.*;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class MyController32 {
	@FXML
	private ImageView im;
	@FXML
	private Button bu;
	@FXML
	private ComboBox<String> co;
	@FXML
	private TextArea te;

	public MyController32(){}



	@FXML
	private void eventbutton(){
		String a = co.getValue();
		mainFactory mainfactory;
		AutoInsurance ins =null ;
		if(a=="Body Injure"){
			mainfactory = new BodyPolicy();
			ins = mainfactory.getInsurObj();
		}
		else if(a=="Collision"){
			mainfactory = new ColPolicy();
			ins = mainfactory.getInsurObj();
		}
		else if(a=="Com"){
			mainfactory = new ComPolicy();
			ins = mainfactory.getInsurObj();
		}
		else if(a=="Person Injure"){
			mainfactory = new perPolicy();
			ins = mainfactory.getInsurObj();
		}
		te.setText(ins.getInsurInfo());
	}
}